﻿using DAL;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL
{
    public class RoomTypeBLL
    {
        public RoomTypeDAL RoomTypeDAL { get; }

        public RoomTypeBLL(RoomTypeDAL roomTypeDAL)
        {
            RoomTypeDAL = roomTypeDAL;
        }
        /// <summary>
        /// 房型添加
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public int RoomTypeAdd(RoomTypeModel info)
        {
            try
            {
               return RoomTypeDAL.RoomTypeAdd(info);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 显示查询分页
        /// </summary>
        /// <param name="totalCount">页容量</param>
        /// <param name="totalPage">页码</param>
        /// <param name="Pageindex">当前页</param>
        /// <param name="PageSize">页码</param>
        /// <param name="RoomTypeName">房型名称</param>
        /// <param name="Asay">房型大小</param>
        /// <returns></returns>
        public List<RoomTypeModel> GetRoomTypesList(out int totalCount, out int totalPage, int Pageindex = 1, int PageSize = 2, string? RoomTypeName = "", int? max = null, int? min = null)
        {
            try
            {
               return RoomTypeDAL.GetRoomTypesList(out totalCount, out totalPage, Pageindex, PageSize, RoomTypeName,max,min );
            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}
